﻿using Microsoft.AspNetCore.Identity;

namespace Quickly.Identity;

public class AppUser : IdentityUser<string>, IAuditCreated, IAuditLastModified
{
    public AppUser()
    {
        Id = GenerateId();
        SecurityStamp = Guid.NewGuid().ToString();
        CreatedTime = DateTimeOffset.UtcNow;
        LastModifiedTime = DateTimeOffset.UtcNow;
    }

    protected virtual string GenerateId()
    {
        return Guid.NewGuid().ToString();
    }

    public AppUser(string userName) : this()
    {
        UserName = userName;
    }

    public DateTimeOffset CreatedTime { get; set; } = default!;
    public DateTimeOffset LastModifiedTime { get; set; } = default!;
}
